package com.kaifamiao.form;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet( "/customer/list" )
public class CustomerListServlet extends HttpServlet {

    @Override
    protected void service( HttpServletRequest request , HttpServletResponse response )
            throws ServletException, IOException {
        // 设置请求的编码
        request.setCharacterEncoding( "UTF-8" );
        // 设置响应的编码
        response.setCharacterEncoding( "UTF-8" );
        // 设置 content-type
        response.setContentType( "text/html");
        // 获得打印流
        PrintWriter out = response.getWriter();

        // 在 servlet 中使用 CSS 样式
        out.println( "<link rel='stylesheet' href='/bootstrap/css/bootstrap.css' >" );
        out.println( "<link rel='stylesheet' href='/font-awesome/css/font-awesome.css' >" );

        out.println( "<div class='container border'>");

        out.println( "<div class='row border' style='margin: 5px;'>" );
        out.println( "<span class='col-4'>1</span>" );
        out.println( "<span class='col-8'>2</span>" );
        out.println( "</div>" );

        out.println( "<a href='/sign/up' class='btn btn-primary</a>" );

        out.println( "</div>" );

    }

}
